home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / diskutil / ff32src.zoo / stddef.h < prev   
C/C++ Source or Header  |  1989-08-10  |  1KB  |  53 lines

  1. /* Standard definitions to use -- boolean variables, etc */
  2. #ifndef STDDEF_H
  3. #define STDDEF_H
  4.  
  5. typedef unsigned long LONG;
  6. typedef unsigned WORD;
  7. typedef unsigned char BYTE;
  8. typedef unsigned char SHORT;
  9. typedef void VOID;
  10.  
  11. #define MAXINT 0xFFFF
  12. #define MAXLONG 0xFFFFFFFF
  13.  
  14. #define NULL ((char *)0)
  15. #ifndef NIL
  16. #define NIL '\0'
  17. #endif
  18.  
  19. typedef char BOOLEAN;
  20. #define FALSE 0
  21. #define TRUE (!FALSE)
  22.  
  23. typedef VOID (func)();
  24. typedef int (ifunc)();
  25. typedef LONG (lfunc)();
  26.  
  27. /* Inclusive between macro */
  28. #define IBETWEEN(x, a, b) (((x) >= (a) && (x) <= (b)) ? TRUE : FALSE)
  29. /* Exclusive between macro */
  30. #define EBETWEEN(x, a, b) (((x) > (a) && (x) < (b)) ? TRUE : FALSE)
  31.  
  32. extern char *strcat();
  33. extern char *malloc();
  34. extern char *lmalloc();
  35.  
  36. typedef struct { int w,h; } wh;
  37. typedef struct { int x,y; } xy;
  38. typedef struct { int x,y,w,h; } xywh;
  39. typedef struct { int x,y,x1,y1; } xyxy;
  40. typedef struct { int x,y,x1,y1,x2,y2,x3,y3; } xyxyxyxy;
  41.  
  42. #define XYWH_PTR(a) &a.x, &a.y, &a.w, &a.h
  43. #define XYXY_PTR(a) &a.x, &a.y, &a.x1, &a.y1
  44. #define XY_PTR(a) &a.x, &a.y
  45. #define WH_PTR(a) &a.w, &a.h
  46. #define XYXYXYXY_PTR(a) &a.x, &a.y, &a.x1, &a.y1, &a.x2, &a.y2, &a.x3, &a.y3
  47. #define MAX(a, b) ((a) > (b) ? (a) : (b))
  48. #define MIN(a, b) ((a) < (b) ? (a) : (b))
  49.  
  50. #define new(p) ((p) = malloc(sizeof(*p)))   /* Like Pascal's new */
  51.  
  52. #endif
  53.